package com.codepilot.server.model.vo;

import java.io.Serializable;

import lombok.Data;

@Deprecated
@Data
public class CommonResponse<T> implements Serializable {

    private Integer code;
    private String msg;
    private T data;

    public static <T> CommonResponse<T> success(T data) {
        CommonResponse<T> result = new CommonResponse<>();
        result.setCode(200);
        result.setMsg("success");
        result.setData(data);
        return result;
    }

    public static <T> CommonResponse<T> error(Integer code, String msg) {
        CommonResponse<T> result = new CommonResponse<>();
        result.setCode(code);
        result.setMsg(msg);
        return result;
    }

}
